Page layout is the art of positioning graphical elements, such as text and graphics objects, on the page with the aim of creating a desired aesthetic effect.
In order to realise a certain aesthetic effect, the document author will want to retain control over most aspects of page layout. However, there are some circumstances under which a certain degree of automated layout, within specified constraints, is of great benefit.
Variable Data Printing, or VDP, is an example of a class of application that benefits from constraint-based automatic layout. VDP allows for the printing of a large number of documents, each of which contains text and graphics objects that have been customised to the document's recipient (so-called variable text and graphics objects).
A VDP document begins with a template containing static text and graphics. The document author then adds placeholders that define how content elements, such as variable text and graphics objects, are to be selected and laid out.
A container defines an area on a page that can hold display content elements, such as images, text, or other media elements. Containers have a size and position that can be fixed, or can vary by negotiating for space with other containers. A container's bounds are not necessarily confined to the printable area of the page. A straight line segment of the border of a container is referred to as an edge.
An edge can either be either fixed or movable. A fixed edge is constrained to an absolute position on the page. A movable edge has a position that can change according to the placed elements and the rules of the containers.
Multiple elements may used in the layout. These elements may vary in size and proportion. Without constraint-based automatic layout, each element would be assigned to a container with fixed edges. However, this inflexible approach can lead to an inappropriate amount of space being allocated in many instances.
For example, two adjacent containers of the same size could be occupied by images with greatly differing sizes, leading to the larger image being scaled down and the smaller image failing to fill its space. This can also lead to undesired space around and between elements, due to the actual element differing in aspect ratio from the allocated container. Better results may be obtained if the neighbouring containers are able to negotiate with each other to determine the best area to allocate to each container. Such negotiation is typically carried out by an automatic layout process using the constraints and the element properties.
Often a layout contains groups of elements which are arranged in some pattern. For example, a row of images might be aligned so that the top and bottom of each image lie along the same line; or they might all have the same width. These designs can best be achieved by treating the group as a single element, and dividing up the container space among the elements internally after laying out the container for the group.
There are other (non-VDP) applications which nevertheless are template based. Templates are very good at defining precise layouts, into which content may be added. However, it is desirable to define a template which defines a general appearance, but allows the flexible use of different numbers and size of elements. This would allow multiple documents to be produced with a similar appearance from a single template. Such an approach can also free the document author from some tedious aspects of manually balancing elements against each other.
Arising from the scenarios described above is desire for a mechanism to set constraints and properties to allow group containers to negotiate with each other and with other containers to determine the size of each container, according to the properties of the contained elements.
Some previous solutions have involved the creation of single layout elements, and have given the user some way to specify constraints between them. This makes it difficult to design layouts that treat a collection of elements as a group, and apply similar layout constraints to all of them consistently. Additionally, this approach can not be used to create documents with different numbers of document elements from the same template.
Other previous solutions have offered a mechanism to include multiple elements within a single container, but have limited layout capabilities. For example, some solutions, such as that described in International Patent Publication No. WO 2001009834 (Curl), allow multiple elements to be arranged in a single container, but do not have the ability to adjust both the horizontal and vertical sizes simultaneously—only one of those dimensions can depend on the other, which places limits on its ability to successfully arrange elements that, for example, have a preferred relationship between width and height.